function [lengthNet] = getlength(G,XY,nnod)
%%%  calculate the length of a network
lengthNet=0;n=0;m=0;
for n=1:nnod,
    for m=n+1:nnod,
        if G(n,m)==1, lengthNet=lengthNet+sqrt((XY(m,:)-XY(n,:))*(XY(m,:)-XY(n,:))');
        end
    end
end